import React from 'react'
import ReactDOM from 'react-dom/client'
import { ConfigProvider } from 'antd'
// 引入Ant Design中文语言包
import { RouterProvider } from 'react-router-dom'
import { globalRouters } from '@/router'
import { store } from '@/store'
import { Provider } from 'react-redux'
// import './mock'
// import Account from '@/pages/account'
import zhCN from 'antd/locale/zh_CN'
// 全局样式
import '@/common/style/frame.scss'


const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
    <Provider store={store}>
        <ConfigProvider locale={zhCN}>
            <RouterProvider router={globalRouters} />
        </ConfigProvider>
    </Provider>
)

// 错误：
//  在yarn eject出webpack.config.js后，出现了如下的报错：Parsing error: [BABEL] /Users/.../App.js: Using babel-preset-react-app requires that you specify NODE_ENV or BABEL_ENV environment variables.
// Valid values are "development", "test", and "production". Instead, received: undefined. (While processing: "/Users/.../node_modules/babel-preset-react-app/index.js")

// 解决方案：这个错误可以通过更改package.json中的eslintConfig部分，屏蔽babel-preset-react-app，再开启babel-preset-react-app/prod可以解决这个问题
// {
//   "eslintConfig": {
//     "extends": [
//       "react-app",
//       "react-app/jest"
//     ],
//     "parserOptions": {
//       "babelOptions": {
//         "presets": [
//           ["babel-preset-react-app",false],
//           "babel-preset-react-app/prod"
//         ]
//       }
//     }
//   },
// }

